import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '客户中文名称',
    align:"center",
    dataIndex: 'cnName'
   },
   {
    title: '客户英文名称',
    align:"center",
    dataIndex: 'enName'
   },
   {
    title: '客户编码',
    align:"center",
    dataIndex: 'code'
   },
   {
    title: '客户简称',
    align:"center",
    dataIndex: 'nick'
   },
   {
    title: '客户简介',
    align:"center",
    dataIndex: 'description'
   },
   {
    title: '客户地址',
    align:"center",
    dataIndex: 'address'
   },
   {
    title: '客户网址',
    align:"center",
    dataIndex: 'website'
   },
   {
    title: '客户LOGO',
    align:"center",
    dataIndex: 'logo',
    customRender:render.renderImage,
   },
   {
    title: '客户电话',
    align:"center",
    dataIndex: 'phone'
   },
   {
    title: '客户联系人',
    align:"center",
    dataIndex: 'contact'
   },
   {
    title: '备注',
    align:"center",
    dataIndex: 'remark'
   },
   {
    title: '是否启用',
    align:"center",
    dataIndex: 'enableFlag_dictText'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '客户中文名称',
    field: 'cnName',
    component: 'Input',
  },
  {
    label: '客户英文名称',
    field: 'enName',
    component: 'Input',
  },
  {
    label: '客户编码',
    field: 'code',
    component: 'Input',
  },
  {
    label: '客户简称',
    field: 'nick',
    component: 'Input',
  },
  {
    label: '客户简介',
    field: 'description',
    component: 'Input',
  },
  {
    label: '客户地址',
    field: 'address',
    component: 'Input',
  },
  {
    label: '客户网址',
    field: 'website',
    component: 'Input',
  },
  {
    label: '客户LOGO',
    field: 'logo',
     component: 'JImageUpload',
     componentProps:{
        fileMax: 0
      },
  },
  {
    label: '客户电话',
    field: 'phone',
    component: 'Input',
  },
  {
    label: '客户联系人',
    field: 'contact',
    component: 'Input',
  },
  {
    label: '备注',
    field: 'remark',
    component: 'Input',
  },
  {
    label: '是否启用',
    field: 'enableFlag',
    defaultValue: "Y",
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"enable_flag",
        type: "radio"
     },
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  cnName: {title: '客户中文名称',order: 0,view: 'text', type: 'string',},
  enName: {title: '客户英文名称',order: 1,view: 'text', type: 'string',},
  code: {title: '客户编码',order: 2,view: 'text', type: 'string',},
  nick: {title: '客户简称',order: 3,view: 'text', type: 'string',},
  description: {title: '客户简介',order: 4,view: 'text', type: 'string',},
  address: {title: '客户地址',order: 5,view: 'text', type: 'string',},
  website: {title: '客户网址',order: 6,view: 'text', type: 'string',},
  logo: {title: '客户LOGO',order: 7,view: 'image', type: 'string',},
  phone: {title: '客户电话',order: 8,view: 'text', type: 'string',},
  contact: {title: '客户联系人',order: 9,view: 'text', type: 'string',},
  remark: {title: '备注',order: 10,view: 'text', type: 'string',},
  enableFlag: {title: '是否启用',order: 11,view: 'radio', type: 'string',dictCode: 'enable_flag',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}